import request from "../request/request";
import {MenuData} from "@/type/MenuData.ts";

export function getMenu(){

    return request({

        url: 'api/menu/getMenu',
        method: 'GET'
    })
}


export function getList(){

    return request({

        url: 'api/menu/list',
        method: "GET"
    })
}


export function addMenu(menu: MenuData) {

    return request({
        url: 'api/menu/add',
        method: 'POST',
        data: menu
    })
}


export function updateMenu(menu: MenuData){

    return request({
        url: 'api/menu/update',
        method: 'POST',
        data: menu
    })
}


export function deleteMenu(menuId: number){

    return request({
        url: `api/menu/delete/${menuId}`,
        method: 'DELETE'
    })
}
